package com.example.demo.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.bean.currency.LoginResponse;
import com.example.demo.bean.login.LoginBean;
import com.example.demo.bean.user.UserBean;
import com.example.demo.mapper.login.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//主要验证是否已经登录了
@RestController
@SpringBootApplication
public class GetToken {

    @Autowired
    private UserMapper userMapper;
   public boolean gettoken(String token){
       QueryWrapper<UserBean> wrapper = new QueryWrapper<UserBean>();
       wrapper.eq("token",token);
       System.out.print(userMapper+"aass");
       List<UserBean> userList = userMapper.selectList(wrapper);
       if (userList.isEmpty()) {
           return false;
       }
       return true;
   }
}
